<template>
  <div class="analysis-domain-log-table">
    <Table
      :loading="loading"
      ref="analysisDomianLogTable"
      :columns="columns"
      :data="list"
      :disabled-hover="true"
      stripe
    ></Table>
    <div class="form-page-bottom-area flx-row-e-c">
      <Page
        :total="pageData.total"
        :current="pageData.page"
        :page-size="pageData.limit"
        :page-size-opts="pageData.pageSizeOpts"
        @on-change="pageChange"
        @on-page-size-change="pageSizeChange"
        show-elevator
        show-sizer
        show-total
      />
    </div>
  </div>
</template>
<script>
export default {
  name: "analysisDomianLogTable",
  props: {
    list: {
      type: Array,
      default: () => [],
    },
    total: {
      type: Number,
      default: 0,
    },
    loading: {
      type: Boolean,
      default: false,
    },
    pageData: {
      type: Object,
      default: () => {
        return {
          total: 0,
          page: 1,
          limit: 10,
          pageSizeOpts: [10, 15, 20],
        };
      },
    },
  },
  data() {
    return {
      columns: [
        {
          width: 200,
          title: "时间",
          key: "createdTime",
          align: "center",
        },
        {
          width: 150,
          title: "操作类型",
          key: "type",
          align: "center",
        },
        {
          ellipsis: true,
          title: "内容",
          key: "content",
          align: "center",
        },
      ],
    };
  },
  methods: {
    pageChange(val) {
      this.$emit("pageChange", val);
    },
    pageSizeChange(val) {
      this.$emit("pageSizeChange", val);
    },
  },
};
</script>
<style lang="scss" scoped>
.analysis-domain-log-table /deep/ {
  .form-page-bottom-area {
    border: none;
  }
  .ivu-table-wrapper {
    .ivu-table-cell {
      &:nth-child(1) {
        padding-left: 10px;
        padding-right: 10px;
      }
    }
    .ivu-table-header {
      border-top: 1px solid #e8eaec;
      border-left: 1px solid #e8eaec;
      border-right: 1px solid #e8eaec;
    }
    .ivu-table-row {
      border-left: 1px solid #e8eaec;
      border-right: 1px solid #e8eaec;
      &:hover {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
        // border-color: transparent;
        transform: scale(1.01);
      }
    }
  }
}
</style>
